﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Romeo.WinForms;

namespace Romeo.Data
{
    public abstract class Strategy : EvaluationStatistics
    {
        public event EventHandler<CellEventArgs> MoveSelected;
        public event EventHandler<CellEventArgs> BestMoveSoFar;

        /// <summary>
        ///     Given a starting position, compute and return the best move
        ///     for the player identified as the computer.
        /// </summary>
        /// <param name="aStartingPosition">
        ///     A board representing the starting position. The strategy is
        ///     allowed to modify the board in order to evaluate moves.
        /// </param>

        public abstract void Compute (Board aStartingPosition);
        public virtual string GetStats ()
        {
            return "";
        }

        protected virtual void OnMoveSelected (CellEventArgs e)
        {
            if (MoveSelected != null)
            {
                MoveSelected (this, e);
            }
        }

        protected void DoReportBestSoFar (Board aBoard, int aCell)
        {
            if (BestMoveSoFar != null)
            {
                BestMoveSoFar (this, new CellEventArgs (aBoard, aCell));
            }
        }


    }
}
